﻿using System;

namespace LeanEngine.Business.Security
{
    /// <summary>
    /// Provides a behavior to evaluate if a user has or not grant access to execute a method.
    /// </summary>
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
    public class SecureBehaviorAttribute : Attribute
    {
        /// <summary>
        /// Initializes a new instance of LeanEngine.Business.Security.SecureBehaviorAttribute class.
        /// </summary>
        public SecureBehaviorAttribute()
        {
            this.ValidatorBehavior = DefaultValidatorBehavior.Instance;
        }

        /// <summary>
        /// Gets or sets the behavior to evaluate if a user has or not grant access to execute a method.
        /// </summary>
        public virtual IValidatorBehavior ValidatorBehavior
        {
            get;
            set;
        }
    }
}
